<!--
 * @Descripttion: 文件说明
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-07-29 10:40:40
 * @LastEditors: GW
 * @LastEditTime: 2021-11-01 11:37:32
-->
<template>
  <div class="form-group">
    <label :style="finalLabelStype" :class="labelClass"><span v-if="required" class="required ">*</span>{{ title }}：</label>
    <div :class="rightClass" :style="rightStyle">
      <form-pop :content="error"/>
      <a-checkbox-group
        :value="value || []"
        :options="dataList"
        @change="onChange"
      />
      <slot name="actions" class="action"></slot>
    </div>
  </div>
</template>
<script>
import formAttr from "@/mixins/form/form-attr";

const defaultLabelStype =
  "font-weight: normal;justify-content: flex-end;padding-left: 5px;text-align: right;width:110px;";

export default {
  name: "FormCheckBox",
  mixins: [formAttr],
  props: {
    dataList: {
      type: Array,
      default: () => []
    },
    checkedList: {
      type: Array,
      default: () => []
    },
  },
  data() {
    return {
    
    };
  },
  created() {
   
  },
  mounted(){
      console.log(" this.dataList", this.dataList, this.checkedList);
  },
  computed: {
    finalLabelStype: function() {
      return this.labelStyle || defaultLabelStype;
    }
  },
  methods: {
    onChange(checkedList) {
      console.log("checkedList", checkedList);
      // this.$emit("update:checkedList", checkedList);
      this.$emit("input", checkedList);
    }
  }
};
</script>
